<template>
	<view class="plan-card">
		<view class="plan-card-left">
			<view class="left-top">
				<u-image width="146rpx" height="146rpx" :src="data.frontalView" border-radius="16rpx"></u-image>
			</view>
			<view class="left-bottom">
				<u-image width="26rpx" height="32rpx" src="/static/index/location2.png"></u-image>
				<span class="number">{{data.distance||'--'}}km</span>
			</view>
		</view>
		<view class="plan-card-right">
			<view class="right-header">
				<view class="haeder-left">
					<view class="title">
						{{data.breed}}
					</view>
				</view>
			</view>
			<view class="right-center">
				<custom-tag cbackground="rgba(255,214,0,0.05)" cborder="2rpx solid #FFD600"
					:text="data.gender===0?'公':'母'"></custom-tag>
			</view>
			<view class="right-bottom">
				{{data.feature}}
			</view>
		</view>
	</view>
</template>

<script>
	import customTag from "components/common/custom-tag.vue"
	export default {
		props: {
			data: {
				type: Object,
				default: {
					breed: "", //品种
					discoveryLocation: "", //	发现地点
					feature: "", //特征
					frontalView: "", //正面照
					gender: 0,
					lat: 0,
					leftSideView: "",
					lng: 0,
					remark: "",
					rightSideView: "",
					distance: 0,
				}
			},
		},
		components: {
			customTag
		},
	}
</script>

<style lang="scss" scoped>
	.plan-card {
		display: flex;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 24rpx;

		.plan-card-left {
			.left-bottom {
				display: flex;
				align-items: center;
				margin-top: 18rpx;

				.number {
					font-weight: 500;
					font-size: 12px;
					color: #999999;
					display: block;
				}
			}
		}

		.plan-card-right {
			flex: 1;

			.right-header {
				display: flex;
				justify-content: space-between;

				.haeder-left {
					display: flex;
					align-items: center;
					padding-left: 16rpx;

					.title {
						font-weight: bold;
						font-size: 32rpx;
						color: #000000;
					}
				}

				.header-right {
					font-weight: bold;
					color: #FF7676;
					text-align: left;
					font-style: normal;

					.unit {
						font-size: 24rpx;
					}

					.number {
						font-size: 40rpx;
					}
				}
			}

			.right-center {
				margin-top: 8rpx;
				display: flex;
				flex-wrap: wrap;
			}

			.right-bottom {
				margin-left: 16rpx;
				margin-top: 8rpx;
				font-weight: 500;
				font-size: 28rpx;
				color: #333333;
				display: -webkit-box;
				/* 必须设置此项才能生效 */
				-webkit-line-clamp: 2;
				/* 限制最大行数 */
				-webkit-box-orient: vertical;
				/* 垂直布局 */
				overflow: hidden;
				/* 超出部分隐藏 */
				text-overflow: ellipsis;
				/* 显示省略号 */
			}
		}
	}
</style>